const express = require('express');
const router = express.Router();
router.get('/forCurrentUser', (req, res) => {
    const content = [];
    for(let i = 0; i < 20; i++)
        content.push({
            id: `2020${i}`,
            code: 'string',
            questionContent: 'string',
            description: 'string',
            isCheck: true,
            status: 0,
            rowVersion: 'string',
            details: [
                {
                    id: '1',
                    serialNumber: 0,
                    optionName: 'string'
                },
                {
                    id: '2',
                    serialNumber: 0,
                    optionName: 'string'
                },
            ],
            options: ['update', 'abandon', 'effective']
        });
    res.json({
        message: '',
        payload: {
            content,
            totalElements: 20,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json(
        {
            message: 'string',
            payload: {
                id: '1',
                code: 'string',
                questionContent: 'string',
                description: 'string',
                isCheck: true,
                status: 0,
                rowVersion: 'string',
                details: [
                    {
                        id: '1',
                        serialNumber: 0,
                        optionName: 'string'
                    },
                    {
                        id: '2',
                        serialNumber: 0,
                        optionName: 'string'
                    },
                ],
            }
        }
    );
});

router.put('/:id', (req, res) => {
    res.json(
        {
            message: '修改成功'
        }
    );
});

router.post('/', (req, res) => {
    res.json(
        {
            message: '新增成功'
        }
    );
});

router.put('/:id/abandon', (req, res) => {
    res.json({
        message: '作废成功'
    });
});
router.put('/:id/effective', (req, res) => {
    res.json({
        message: '生效成功'
    });
});

module.exports = router;
